local skel = fk.CreateSkill({
  name = "kpaI__chuyue",
})

Fk:loadTranslationTable{
  ["kpaI__chuyue"] = "雏乐",
  [":kpaI__chuyue"] = "其他角色造成传导伤害结算后，你可以翻面并视为使用一张无法抵消的【铁索连环】。",

  ["$kpaI__chuyue1"] = "裁纸为链作铁索，缚得苍龙请长缨。",
  ["$kpaI__chuyue2"] = "纸上塑长缨，东风乍起，吹起长虹贯长空。",

}

skel:addEffect(fk.DamageFinished, {
  mute = true,
  can_refresh = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and data.chain_table
  end,
  on_refresh = function (self, event, target, player, data)
    player.room:setPlayerMark(player,"kpaI__chuyue",data.chain_table[#data.chain_table].id)
  end
})

skel:addEffect(fk.DamageFinished, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and data.chain and player:getMark("kpaI__chuyue") == data.to.id
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:turnOver()
    if not player:canUse(Fk:cloneCard("iron_chain")) then return end
    local use = room:askToUseVirtualCard(player,{
      name = "iron_chain",
      skill_name = skel.name,
      cancelable = false,
      skip = true,
    })
    if use then
      use.disresponsiveList = table.simpleClone(room.players)
      room:useCard(use)
    end
  end,
})

return skel
